package java10;

import java.util.Scanner;

public class Visitor {
	String name;
	int age;
	public void show(){
		Scanner input=new Scanner(System.in);
		while(!"n".equals(name)){
			if(age>=18&&age<=60){
				System.out.println("姓名"+name+"门票20元");

			}else{
				System.out.println("免费");
			}
			System.out.println("请输入姓名");
			name=input.next();
			if(!"n".equals(name)){
				System.out.println("请输入年龄");
				age=input.nextInt();
			}	
		}
		System.out.println("程序结束！");
	}
}